<div class="form ">

    <?php if( $model->scenario==='update' ): ?>

    <fieldset>
        <legend>
            <?php echo Rights::getAuthItemTypeName($model->type); ?>
        </legend>

        <?php endif; ?>

        <?php $form=$this->beginWidget('CActiveForm'); ?>

        <div class="">
            <?php echo $form->labelEx($model, 'name'); ?>
            <?php echo $form->textField($model, 'name', array('maxlength'=>255, 'class'=>'text-field')); ?>
            <?php echo $form->error($model, 'name'); ?>
            <p class="hint">
                <?php echo Rights::t('core', 'Do not change the name unless you know what you are doing.'); ?>
            </p>
        </div>

        <div class="">
            <?php echo $form->labelEx($model, 'description'); ?>
            <?php echo $form->textField($model, 'description', array('maxlength'=>255, 'class'=>'text-field')); ?>
            <?php echo $form->error($model, 'description'); ?>
            <p class="hint">
                <?php echo Rights::t('core', 'A descriptive name for this item.'); ?>
            </p>
        </div>

        <?php if( Rights::module()->enableBizRule===true ): ?>

        <div class="">
            <?php echo $form->labelEx($model, 'bizRule'); ?>
            <?php echo $form->textField($model, 'bizRule', array('maxlength'=>255, 'class'=>'text-field')); ?>
            <?php echo $form->error($model, 'bizRule'); ?>
            <p class="hint">
                <?php echo Rights::t('core', 'Code that will be executed when performing access checking.'); ?>
            </p>
        </div>

        <?php endif; ?>

        <?php if( Rights::module()->enableBizRule===true && Rights::module()->enableBizRuleData ): ?>

        <div class="">
            <?php echo $form->labelEx($model, 'data'); ?>
            <?php echo $form->textField($model, 'data', array('maxlength'=>255, 'class'=>'text-field')); ?>
            <?php echo $form->error($model, 'data'); ?>
            <p class="hint">
                <?php echo Rights::t('core', 'Additional data available when executing the business rule.'); ?>
            </p>
        </div>

        <?php endif; ?>

        <div class=" buttons">
            <?php echo submitButton(Rights::t('core', 'Save')); ?>
            |
            <?php echo CHtml::link(Rights::t('core', 'Cancel'), Yii::app()->user->rightsReturnUrl); ?>
        </div>

        <?php $this->endWidget(); ?>

    </fieldset>

</div>
